<?php
/* @var $this KelompokController */
/* @var $model Kelompok */
/* @var $form CActiveForm */
$request = app()->request;
if ($request->enableCsrfValidation) {
    echo CHtml::metaTag($request->getCsrfToken(), 'csrf-token');
    echo CHtml::metaTag($request->csrfTokenName, 'csrf-param');
}
$isnew = $model->isNewRecord;
?>
<div class="form">
    <?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'kelompok-form',
    'enableAjaxValidation' => false,)); ?>
    <p class="note">Fields with <span class="required">*</span> are required.</p>
    <?php echo $form->errorSummary($model); ?>
    <table border="0" cellpadding="0" cellspacing="0" id="id-form">
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('Kabupaten'); ?></th>
            <td class="idform">
                <?php echo $form->hiddenField($model, 'id_kabupaten'); ?>
                <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                'name' => 'laskar_auto',
                'source' => url('kelompok/getlistkabupaten'),
                'value'=> $isnew ? '' : u::get_model_by_id('kabupaten',$model->id_kabupaten)->nama_kabupaten,
                'options' => array(
                    'showAnim' => 'fold',
                    'select' => 'js:function(event, ui){ jQuery("#' . CHtml::activeId($model, 'id_kabupaten') .
                        '").val(ui.item["id"]); }'
                ),
                'htmlOptions' => array('size' => '60'))); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('id_kabupaten')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'id_kabupaten', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('nama kelompok'); ?></th>
            <td class="idform">
                <?php echo $form->textField($model, 'nama_kelompok',
                array('size' => 60, 'maxlength' => 250)); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('nama_kelompok')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'nama_kelompok', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('ketua'); ?></th>
            <td class="idform">
                <?php echo $form->hiddenField($model, 'ketua'); ?>
                <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                'name' => 'ketua_auto',
                'source' => url('kelompok/getlistjamaah'),
                'value'=> $model->ketua0 == null ? " " : $model->ketua0->nama,//$model->ketua0->nama,
                'options' => array(
                    'showAnim' => 'fold',
                    'select' => 'js:function(event, ui){ jQuery("#' . CHtml::activeId($model, 'ketua') .
                        '").val(ui.item["id"]); }'),
                'htmlOptions' => array('size' => '60'))); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('ketua')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'ketua', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('wakil_ketua'); ?></th>
            <td class="idform">
                <?php echo $form->hiddenField($model, 'wakil_ketua'); ?>
                <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                'name' => 'wakil_ketua_auto',
                'source' => url('kelompok/getlistjamaah'),
                'value'=> $model->wakilKetua == null ? " " : $model->wakilKetua->nama,//$model->wakilKetua->nama,
                'options' => array(
                    'showAnim' => 'fold',
                    'select' => 'js:function(event, ui){ jQuery("#' . CHtml::activeId($model, 'wakil_ketua') .
                        '").val(ui.item["id"]); }'),
                'htmlOptions' => array('size' => '60'))); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('wakil_ketua')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'wakil_ketua', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('imam'); ?></th>
            <td class="idform">
                <?php echo $form->hiddenField($model, 'imam'); ?>
                <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                'name' => 'imam_auto',
                'source' => url('kelompok/getlistjamaah'),
                'value'=>$model->imam0 == null ? " " : $model->imam0->nama, // $model->imam0->nama,
                'options' => array(
                    'showAnim' => 'fold',
                    'select' => 'js:function(event, ui){ jQuery("#' . CHtml::activeId($model, 'imam') .
                        '").val(ui.item["id"]); }'),
                'htmlOptions' => array('size' => '60'))); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('imam')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'imam', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('wakil_imam_1'); ?></th>
            <td class="idform">
                <?php echo $form->hiddenField($model, 'wakil_imam_1'); ?>
                <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                'name' => 'wakil_imam_1_auto',
                'source' => url('kelompok/getlistjamaah'),
                'value'=> $model->wakilImam1 == null ? " " : $model->wakilImam1->nama,//$model->wakilImam1->nama,
                'options' => array(
                    'showAnim' => 'fold',
                    'select' => 'js:function(event, ui){ jQuery("#' . CHtml::activeId($model, 'wakil_imam_1') .
                        '").val(ui.item["id"]); }'),
                'htmlOptions' => array('size' => '60'))); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('wakil_imam_1')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'wakil_imam_1', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('wakil_imam_2'); ?></th>
            <td class="idform">
                <?php echo $form->hiddenField($model, 'wakil_imam_2'); ?>
                <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                'name' => 'wakil_imam_2_auto',
                'source' => url('kelompok/getlistjamaah'),
                'value'=> $model->wakilImam2 == null ? " " : $model->wakilImam2->nama,//$model->wakilImam2->nama,
                'options' => array(
                    'showAnim' => 'fold',
                    'select' => 'js:function(event, ui){ jQuery("#' . CHtml::activeId($model, 'wakil_imam_2') .
                        '").val(ui.item["id"]); }'),
                'htmlOptions' => array('size' => '60'))); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('wakil_imam_2')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'wakil_imam_2', array('class' => 'error-inner')); ?>
            </td>
        </tr>
         <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('Kegiatan'); ?></th>
            <td class="idform">
                <?php $this->widget('ext.tinymce.TinyMce', array(
                'model' => $model,
                'attribute' => 'kegiatan',
                'fileManager' => array(
                    'class' => 'ext.elFinder.TinyMceElFinder',
                    'connectorRoute' => 'elfinder/connector',),
                'htmlOptions' => array('rows' => 6, 'cols' => 60,),)); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('kegiatan')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'kegiatan', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $model->getAttributeLabel('keterangan'); ?></th>
            <td class="idform">
                <?php
//                $this->widget('ext.xheditor.XHeditor',array(
//                'model'=>$model,
//                'modelAttribute'=>'keterangan',
//                'config'=>array(
//                    'id'=>'xheditor_1',
//                    'tools'=>'mfull', // mini, simple, mfull, full or from XHeditor::$_tools, tool names are case sensitive
//                    'skin'=>'vista', // default, nostyle, o2007blue, o2007silver, vista
//                    'width'=>'740px',
//                    'height'=>'400px',
//                    'loadCSS'=>XHtml::cssUrl('editor.css'),
//                    'upImgUrl'=>$this->createUrl('request/uploadFile'),
//                    'upImgExt'=>'jpg,jpeg,gif,png',
//                ),
//            ));
                ?>
                <?php $this->widget('ext.tinymce.TinyMce', array(
                'model' => $model,
                'attribute' => 'keterangan',
                'fileManager' => array(
                    'class' => 'ext.elFinder.TinyMceElFinder',
                    'connectorRoute' => 'elfinder/connector',),
                'htmlOptions' => array('rows' => 6, 'cols' => 60,),)); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('keterangan')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'keterangan', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th>&nbsp;</th>
            <td valign="top">
                <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',
                array('class' => 'form-submit')); ?>
            </td>
            <td class="idform"></td>
        </tr>
    </table>
    <?php $this->endWidget(); ?>
</div><!-- form -->